<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="Links.aspx.cs" Inherits="Admin_Links" Title="Untitled Page" %>

<%@ Register Assembly="FreeTextBox" Namespace="FreeTextBoxControls" TagPrefix="FTB" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Main" Runat="Server">
  <table style="width: 100%; height: 100%">
      <tr>
          <td align="center" style="width: 100px; height: 59px;">
              <h3>Edit Links</h3>
          </td>
      </tr>
        <tr>
            <td style="width: 100px; height: 584px;" align="center" valign=top>
                <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
                    <asp:View ID="View1" runat="server">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td style="width: 100px">
                            <asp:Button ID="but_New" runat="server" CausesValidation="False" OnClick="but_New_Click"
                                Text="New" /></td>
                                <td style="width: 100px">
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="width: 100px">
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
                    AutoGenerateColumns="False" CellPadding="4" DataSourceID="odsLinks"
                    ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" OnRowDeleting="GridView1_RowDeleting" DataKeyNames="LIN_ID" OnRowDataBound="GridView1_RowDataBound" Width="748px">
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="LIN_DISPLAY" HeaderText="DISPLAY" SortExpression="LIN_DISPLAY" />
                        <asp:BoundField DataField="LIN_URL" HeaderText="URL" SortExpression="LIN_URL" />
                        <asp:BoundField DataField="LIN_ALT" HeaderText="ALT" SortExpression="LIN_ALT" Visible="False" />
                        <asp:BoundField DataField="LIN_DESCRIPTION" HeaderText="DESCRIPTION" SortExpression="LIN_DESCRIPTION" />
                        <asp:BoundField DataField="LCA_NAME" HeaderText="CATEGORY" SortExpression="LCA_NAME" />
                        <asp:BoundField DataField="LIN_LCA_ID" HeaderText="LIN_LCA_ID" SortExpression="LIN_LCA_ID"
                            Visible="False" />
                        <asp:BoundField DataField="LIN_ID" HeaderText="ID" InsertVisible="False" SortExpression="LIN_ID" Visible="False" />
                        <asp:CommandField ShowDeleteButton="True" />
                    </Columns>
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <EditRowStyle BackColor="#999999" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                </asp:GridView>
                                </td>
                            </tr>
                        </table>
                    </asp:View>
                    <asp:View ID="View2" runat="server">
                <table>
                    <tr>
                        <td align="right" style="width: 100px" valign="top">
                            <asp:Label ID="Label1" runat="server" Text="Url"></asp:Label></td>
                        <td align="left" style="width: 265px">
                            <asp:TextBox ID="tbo_Url" runat="server" MaxLength="255" Width="496px"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 100px" valign="top">
                            <asp:Label ID="Label2" runat="server" Text="Display"></asp:Label></td>
                        <td align="left" style="width: 265px">
                            <asp:TextBox ID="tbo_Display" runat="server" MaxLength="255" Width="496px"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 100px; height: 18px" valign="top">
                            <asp:Label ID="Label3" runat="server" Text="Alt"></asp:Label></td>
                        <td align="left" style="width: 265px; height: 18px">
                            <asp:TextBox ID="tbo_Alt" runat="server" MaxLength="255" Width="496px"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 100px; height: 75px" valign="top">
                            <asp:Label ID="Label5" runat="server" Text="Description"></asp:Label></td>
                        <td align="left" style="width: 265px; height: 75px">
                            <asp:TextBox ID="tbo_Discription" runat="server" Height="96px" MaxLength="1000" TextMode="MultiLine"
                                Width="496px"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 100px" valign="top">
                            <asp:Label ID="Label4" runat="server" Text="Category"></asp:Label></td>
                        <td align="left" style="width: 265px">
                            <asp:DropDownList ID="ddl_Cats" runat="server" DataSourceID="odsCategories" DataTextField="LCA_NAME" DataValueField="LCA_ID">
                            </asp:DropDownList>
                            <asp:Button ID="but_NewCat" runat="server" CausesValidation="False" OnClick="but_NewCat_Click"
                                Text="New Category" />&nbsp;
                            <asp:HiddenField ID="hfi_ID" runat="server" />
                            <asp:HiddenField ID="hfi_Del_ID" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 100px" valign="top">
                            </td>
                        <td align="left" style="width: 265px">
                            <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr>
                                    <td style="width: 100px">
                            <asp:Button ID="but_Save" runat="server" Text="Save" OnClick="but_Save_Click" /></td>
                                    <td align="right" style="width: 100px">
                                        <asp:Button ID="butCancel" runat="server" OnClick="butCancel_Click" Text="Cancel" /></td>
                                </tr>
                            </table>
                            <asp:ObjectDataSource ID="odsLinks" runat="server" DeleteMethod="DeleteLink" SelectMethod="GetLinks"
                                TypeName="LinkManager">
                                <DeleteParameters>
                                    <asp:Parameter Name="LIN_ID" Type="Int32" />
                                </DeleteParameters>
                            </asp:ObjectDataSource>
                            <asp:ObjectDataSource ID="odsCategories" runat="server" OldValuesParameterFormatString="original_{0}"
                                SelectMethod="GetLinkCategories" TypeName="LinkManager"></asp:ObjectDataSource>
                </td>
                    </tr>
                </table>
                    </asp:View>
                </asp:MultiView>
                &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
            </td>
        </tr>
    </table>
    &nbsp; &nbsp;
    &nbsp;&nbsp;
    </asp:Content>

